/**
 * 
 */
let job = new Vue({
	el:'#job',
	data:{
		userisLogin:false,
		hrisLogin:false,
		dialogForm2Visible: false,
	    dialogForm1Visible: false,
		id:'',
		activeName:'first',
		jobid:sessionStorage.getItem("jid"),
		jobDetails:{},
		fileUrl:'',
		fileList:[{
			uid:'',
			jid:'',
			file:null
		}],
		items2: [
			        {
			          title: "首页",
			          index: "/index",
			          class: "index1"
			        },
			        {
			          title: "秋招日历",
			          index: "/ftime",
			          class: "index2"
			        },
			        {
			          title: "大厂信息",
			          index: "/factory",
			          class: "index3"
			        },
			        {
			          title: "校招",
			          index: "/school",
			          class: "index4"
			        },
			        {
			          title: "offer直通车",
			          index: "/offer",
			          class: "index5"
			        }
			      ]
	},
	created(){
		this.getjob();
		this.isLogin();
	},
	methods:{
		isLogin(){
					axios.post('/usert/islogin').then(resp=>{
						this.userisLogin = resp.data;
						this.hrisLogin = resp.data;
						console.log(this.userisLogin+'--'+this.hrisLogin);
						
					}).catch();
					axios.post('/usert/getloginid').then(resp=>{
						let temp = resp.data;
						if(temp!==""){
							this.id = resp.data;
							console.log(temp);
						}
						else{
							console.log(temp);
						}
						
						
					}).catch();
				},
		submit1(){
			if(!this.userisLogin){
				this.$message("请先登录");
			}
			else{
				axios.get('/manager/isDis',{
					params:{
						uid:this.id
					}
				}).then(resp=>{
					if(resp.data<0){
						this.$message.error("您已被禁用，请七天后重试");
					}
					else{
						let data = new FormData();
				data.append("uid",this.id);
				data.append("jid",this.jobid);
				data.append("pfile",this.fileList.file);
				axios.post('/usert/updateResume',data)
					 .then(resp=>{
						this.$message.success("上传成功");
					});
					}
				}).catch();
				
				}
			
		},
		uploadUserRe(item){
			//console.log(item);
			this.fileUrl = URL.createObjectURL(item.file);//blobUrl
			console.log(this.fileUrl);
			this.fileList.file = item.file;
				console.log(this.fileList.file);
			
		},
		getjob(){
			let data = new FormData();
			data.append("jid",this.jobid);
			axios.post('/job/getOne',data)
				 .then(resp=>{
					this.jobDetails = resp.data;
				});
		}
	}
});